package ysy.ioc;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.TextView;

import com.example.mytest.R;

import ysy.ioc.annotation.BindView;
import ysy.ioc.annotation.ContentView;
import ysy.ioc.annotation.ViewClick;

@ContentView(R.layout.activity_main2)
public class IOCActivity extends BaseActivity implements View.OnClickListener {

    private static final String TAG = IOCActivity.class.getClass().getSimpleName();


    @BindView(R.id.tv1)
    TextView tv1;

    @BindView(R.id.tv2)
    TextView tv2;

    @BindView(R.id.tv3)
    TextView tv3;

    int flag=0;


    @Override
    protected void onResume() {
        super.onResume();
        Log.e(TAG, "onResume: "+tv1.getText() );

    }


    @Override
    @ViewClick({R.id.tv1,R.id.tv2,R.id.tv3})
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.tv1:
                tv1.setText("一号升级了");
                break;
            case R.id.tv2:
                startActivity(new Intent(this,IOCActivity2.class));
                break;
            case R.id.tv3:
                tv1.setText("一号升级了");
                break;
        }
    }
}